var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var i, c = arguments.length, r = c < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, n); else for (var a = t.length - 1; 0 <= a; a--) (i = t[a]) && (r = (c < 3 ? i(r) : 3 < c ? i(e, o, r) : i(e, o)) || r);
    return 3 < c && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("LoadManager"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.buttonBg = null, t.info = null, t.infoLabel = null, t.app = null, t.type = null, 
        t;
    }
    return i(t, e), t.prototype.start = function() {}, t.prototype.setInfo = function(t, e) {
        var o = this;
        t && (this.app = t, this.type = e, this.app.icon && r.default.getInstance().load({
            url: this.app.icon,
            success: function(t) {
                try {
                    t instanceof cc.Texture2D ? o.buttonBg.spriteFrame = new cc.SpriteFrame(t) : cc.log(t);
                } catch (t) {}
            },
            fail: function(t) {
                cc.error(t);
            }
        }));
    }, t.prototype.showInfo = function(t) {
        if (this.info) switch (t) {
          case 1:
            this.info.active || (this.info.active = !0), this.infoLabel.string = "爆款";
            break;

          case 2:
            this.info.active || (this.info.active = !0), this.infoLabel.string = "热门";
            break;

          default:
            this.info.active && (this.info.active = !1);
        }
    }, t.prototype.onClick = function() {
        var t = this;
        GA.PA.navigateToMiniProgram({
            pkgName: this.app.appid,
            appId: this.app.appid,
            path: this.app.path,
            success: function() {
                GA.saveRedirect(t.type, t.app.appid, t.app.path);
            }
        });
    }, a([ l(cc.Sprite) ], t.prototype, "buttonBg", void 0), a([ l(cc.Node) ], t.prototype, "info", void 0), 
    a([ l(cc.Label) ], t.prototype, "infoLabel", void 0), a([ c ], t);
}(cc.Component);

n.default = d;